home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 17
/
CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso
/
CUCD
/
Programming
/
DiceSource
/
lib
/
string
/
strstr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-09
|
545b
|
35 lines
/*
* STRSTR.C find one string in another
*
* (c)Copyright 1992-1997 Obvious Implementations Corp. Redistribution and
* use is allowed under the terms of the DICE-LICENSE FILE,
* DICE-LICENSE.TXT.
*/
#include <string.h>
#include <errno.h>
#ifndef HYPER
#define HYPER(x) x
#endif
char *
HYPER(strstr)(s1, s2)
const char *s1;
const char *s2;
{
short len2 = strlen(s2);
if (len2 == 0)
return(s1);
while (*s1) {
if (*s1 == *s2 && strncmp(s1, s2, len2) == 0)
return(s1);
++s1;
}
return(NULL);
}